<template>
  <el-dialog v-model="dialogVisible" title="公告详情" destroy-on-close>
    <el-card class="box-card">
      <template #header>
        <div class="card-header">
          <span style="font-size: x-large;font-weight: bolder">
          {{ noticeInfo?.title }}
            </span>
        </div>
      </template>
      <div class="text item">
        <el-row>
          <el-col :span="24">
            <div>
              <img style="width: 100%; height: auto;" :src="noticeInfo?.noticeImg" alt="" />
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <div style="margin-top: 2vh">
              <span style="font-size: medium">
                {{ noticeInfo?.content }}
              </span>
            </div>
          </el-col>
        </el-row>
      </div>
    </el-card>
  </el-dialog>
</template>

<script setup lang="ts">
//-----------组件变量-----------
import { INotice } from "@/api/business/notice/types";
import { ref } from "vue";

const noticeInfo = ref<INotice>();
const dialogVisible = ref(false);

/**
 * 显示弹窗
 */
const showDialog = (info) => {
  noticeInfo.value = info;
  dialogVisible.value = true;
  console.log(noticeInfo.value);
};

defineExpose({ showDialog });
</script>

<style scoped lang="scss">
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.box-card {
  width: 100%;
}
</style>
